UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SlSl+/PV0nNw98WFdGwXY9JgYQR3ItT9sCJ1Ea8i7CI=' 
WHERE 
  key_id = 'dca58957f949d39a9448a96de517c9beb525f74f93a0046a3de34ba20d0c9be1' 
  AND (
    token = 'SlSl+/PV0nNw98WFdGwXY9JgYQR3ItT9sCJ1Ea8i7CI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045