UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pFrRhQTA3I/TaOJaj4ZRMgwjmUfHbQgH4wX32rum+U4=' 
WHERE 
  key_id = '4519193ef0510a9d1f90d065aee696b17df26918994a843db927845747fdbc31' 
  AND (
    token = 'pFrRhQTA3I/TaOJaj4ZRMgwjmUfHbQgH4wX32rum+U4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043