UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGSZ6XSpl14/ZC3snXO2KY5pj8QbD+CSlTB2pazYjAA=' 
WHERE 
  key_id = '70c058bab4570fd9ce305e6a3ea02d9d744d76b8e70b8c4222a108a3c4e0652e' 
  AND (
    token = 'EGSZ6XSpl14/ZC3snXO2KY5pj8QbD+CSlTB2pazYjAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025