UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMyWX9uKHzXMyMs7ZsYEeTYkbSbE1MszDMkay0Jq+1M='
WHERE
key_id = 'b8c17bb3ad02d3e617f94bf6ffd7e8d458fb45cf83282bc12bff9b136335f08f'
AND (
token = 'jMyWX9uKHzXMyMs7ZsYEeTYkbSbE1MszDMkay0Jq+1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)