UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6AGuSDWv7Dx+mwmqr8cWziD5tGxF5nT+Wew0L/rgqiY=' 
WHERE 
  key_id = 'ce39d40669020533a4e54c5041c874b6d49f8e50b960834c5726ba26762b58cc' 
  AND (
    token = '6AGuSDWv7Dx+mwmqr8cWziD5tGxF5nT+Wew0L/rgqiY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00128