UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F4EXK02a4h3+zqY8ddJsTL5+ME34DZQdpNkEQDfvyOw=' 
WHERE 
  key_id = '2df0eddf8f3f8ff1e3450540c5ddfac4a78cdd1dddcd1c8dc1f2781838a08c69' 
  AND (
    token = 'F4EXK02a4h3+zqY8ddJsTL5+ME34DZQdpNkEQDfvyOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048