UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pkLNzc/yFOpkS+YRzLD1g2MU8vnJ3wDqGJNw1k012O4='
WHERE
key_id = '2f7bc838d7a77fe2ced05eb819155b970f6b970b9b4045811bedc617ca5253b7'
AND (
token = 'pkLNzc/yFOpkS+YRzLD1g2MU8vnJ3wDqGJNw1k012O4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)