UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5sI2CYCXh8WYGRAo/tk5+X5Uozqw073ASts1DhMBjxA=' 
WHERE 
  key_id = 'b17a0d6222d5f57d30142336325b6938f9d25ba4c70eb505bde6c96360836bb2' 
  AND (
    token = '5sI2CYCXh8WYGRAo/tk5+X5Uozqw073ASts1DhMBjxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028