UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lbWyLZ+oT/+tzyxGV8Y6aCLzsuNxAs1S7gxMeu/+KvA='
WHERE
key_id = 'f21b41e8d724147246605a8f3d8e8be276de6540b5cb43ea3d1f892a71f05763'
AND (
token = 'lbWyLZ+oT/+tzyxGV8Y6aCLzsuNxAs1S7gxMeu/+KvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)