UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MSeND2pDswH+eKx1kezdiYRV6rCUaOG2lW9b87yRx/c=' 
WHERE 
  key_id = 'a63b95cc920f6f5020afa27417b0dc7d483ea42f1bccb7c6f12ca18d7f01f489' 
  AND (
    token = 'MSeND2pDswH+eKx1kezdiYRV6rCUaOG2lW9b87yRx/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016