UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RNcc0qXHKAqTSpGl2+CkpafIYkT2dJyQr/XmhA/g/EU=' 
WHERE 
  key_id = 'e4d8daa38eaf336f251d9a8c8b8cb8941fd2f8b849a0beee9684873021b5339f' 
  AND (
    token = 'RNcc0qXHKAqTSpGl2+CkpafIYkT2dJyQr/XmhA/g/EU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034