UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4t77dD/fpD9+Cw8N4Q4kCf0vLjNU+I+LfxKtYic1S/o='
WHERE
key_id = '6e3bf6ebacd2aa1e3734eb3e00ff3c02ef10f619e3761b9d9f24564dee9b0279'
AND (
token = '4t77dD/fpD9+Cw8N4Q4kCf0vLjNU+I+LfxKtYic1S/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)