UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'urwvs4lQu/XYDpHXyEXSPYsLCP1f2K5bfU4USNC8PTc='
WHERE
key_id = 'ae6fb7c6e66027168c11dab3e82c584aa4b683849746cf9af8560b8bf3454ce0'
AND (
token = 'urwvs4lQu/XYDpHXyEXSPYsLCP1f2K5bfU4USNC8PTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)