UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MqcPuaiDPXZjD4tHDtEHTsswvPmlaWk0O9093YB7LX0=' 
WHERE 
  key_id = 'b53f5e92b0dd5dcdc12ae945fa2332a12f63923ecb519f581e29b78dd9348b2f' 
  AND (
    token = 'MqcPuaiDPXZjD4tHDtEHTsswvPmlaWk0O9093YB7LX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038