UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HxkOVswuRcID5gWp6hnDOwRzjG4/kK++jEdCNjQ+DgM='
WHERE
key_id = '0ffaf76028add78846b376f91bee8796834b9ae0d344e513b4ff92e43c998754'
AND (
token = 'HxkOVswuRcID5gWp6hnDOwRzjG4/kK++jEdCNjQ+DgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)