UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qXD/AQpYh/CpMlgJaR8MPnuAlJqfk5PN5q/SFlD9zU0=' 
WHERE 
  key_id = '118b3cfb86f7d2c6d2ed11ce95d8154f22d3ef0079f2c70819b6c64ae007e234' 
  AND (
    token = 'qXD/AQpYh/CpMlgJaR8MPnuAlJqfk5PN5q/SFlD9zU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042