UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xRwEBbzROkGcR2Zg+vmln9CZpDb6SMudcE2TxrB6l+Q=' 
WHERE 
  key_id = '420d951567e7730798ac1f4f018547863f180dbfd6eaab857207b9323fe14a52' 
  AND (
    token = 'xRwEBbzROkGcR2Zg+vmln9CZpDb6SMudcE2TxrB6l+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033