UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jcpkPlynNRqL1sFLiFKhWVvAsAS28Xhqt2HOnsJ+9u4='
WHERE
key_id = 'd6fb031e72553bf5a8e282e57afc13e833a1ce7ddc323dff8e58df3e46406e51'
AND (
token = 'jcpkPlynNRqL1sFLiFKhWVvAsAS28Xhqt2HOnsJ+9u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)