UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ICO4sRdMbU6LRK4FN0KbIIN1WLRsDqi7kjoCFCxwG0g=' 
WHERE 
  key_id = '14eb5b05d6ba4807fb94770ab09ee2473b907128d14685148349341003e5c4ff' 
  AND (
    token = 'ICO4sRdMbU6LRK4FN0KbIIN1WLRsDqi7kjoCFCxwG0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00118