UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T3OLmMpH4wwL8b2K6HhbraMpPiprU6Qo+eukfzbX6fM=' 
WHERE 
  key_id = '8219589769d953c2f384108903eb48dce452af527813422afe1ff9616d6b5829' 
  AND (
    token = 'T3OLmMpH4wwL8b2K6HhbraMpPiprU6Qo+eukfzbX6fM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024