UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uBUgRIZNA8N/98Gik9thN+0JfP99tpicuXePHmtOofU=' 
WHERE 
  key_id = '84d836b69663e40df32d43fc8bad4408b7085f8f2f675f61a66e072ec487c126' 
  AND (
    token = 'uBUgRIZNA8N/98Gik9thN+0JfP99tpicuXePHmtOofU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023