UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1OazWNBjx3oS9hPhs9+L+1xnGZZgmkEwcDUQsDsFcco='
WHERE
key_id = '9a60268107241e0839356982f525607561d6a521192a9072eca451305928d6f2'
AND (
token = '1OazWNBjx3oS9hPhs9+L+1xnGZZgmkEwcDUQsDsFcco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)