UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DrLbi4+Nq7S6yh0ZZw/TaQ3LBp/++HUSXTtZNU7WVd4='
WHERE
key_id = '8301c577abb2cfda085a1e3fef97f5aa9190be12b82d862e3d683a91cf8a129b'
AND (
token = 'DrLbi4+Nq7S6yh0ZZw/TaQ3LBp/++HUSXTtZNU7WVd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)