UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iILwGhlrttNykX/lZmv6tiGs3JH5FxW240MIlSLUOp4='
WHERE
key_id = '6d14d75f3c0c05f0c22effad4278b65c1f4b8105f0bdb2e653c27ce83627494a'
AND (
token = 'iILwGhlrttNykX/lZmv6tiGs3JH5FxW240MIlSLUOp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)