UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TmKKSL5CSiIxWO8OOzlAwQM4VAkHi8GRmqGd/xDxjYA='
WHERE
key_id = 'c1eccd2370c2808bb6907c8f264ed2ebdef4d4bb058e3d86c8d0a4bd88d0fe96'
AND (
token = 'TmKKSL5CSiIxWO8OOzlAwQM4VAkHi8GRmqGd/xDxjYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)