UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D+wEoxHmkBSzkl3dX740ULQwrqBwORE+BUk9A9sFG/A=' 
WHERE 
  key_id = 'e7fa7e1923e2d1868fa8659cb2e4a8093ccc596896af567c94c139cf2cfe8e06' 
  AND (
    token = 'D+wEoxHmkBSzkl3dX740ULQwrqBwORE+BUk9A9sFG/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056