UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ae/zoypXrJTR7GX8piqEEvLuB7rUMun01iW7QsOMV40=' 
WHERE 
  key_id = '91cd8d42d18b64ed610798a7da06cb99f74f19cc5a93212f9aef8e7164d3d05d' 
  AND (
    token = 'Ae/zoypXrJTR7GX8piqEEvLuB7rUMun01iW7QsOMV40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027