UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D357HSTERUkftq8hY9aB4gMc+BU+1opXY7hrVJ6g0bA=' 
WHERE 
  key_id = '7102055f6df1abe95505f13c0a492e6344eaf6980e5b199ad80d7c6b0aaa69f7' 
  AND (
    token = 'D357HSTERUkftq8hY9aB4gMc+BU+1opXY7hrVJ6g0bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024