UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ecVaJmqYutQk2GciRtjj6/qmMr8vPIyY1AHPnZwz5s=' 
WHERE 
  key_id = '772ff49bf45cbf7543ae1adf390cea882d07a56f073a3dfb45172a30bcaadac1' 
  AND (
    token = '5ecVaJmqYutQk2GciRtjj6/qmMr8vPIyY1AHPnZwz5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030