UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DCxMUzGdFqsJIz9hM+Z1oMG8AgWyUBLA28pImMC2vi8=' 
WHERE 
  key_id = '3563a5049a4557c4dc564981f9295072605451b50340be0be1f66ff392a20512' 
  AND (
    token = 'DCxMUzGdFqsJIz9hM+Z1oMG8AgWyUBLA28pImMC2vi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016