UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ia7tHpmSnKrMavUUxM7TKKfj2Ehcm029coGAJbqb8ZQ=' 
WHERE 
  key_id = '4806ee5e6072a903ecb0d5e36ec1c0916b02d1d08a42db9e0620a9d9065f549d' 
  AND (
    token = 'Ia7tHpmSnKrMavUUxM7TKKfj2Ehcm029coGAJbqb8ZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035