UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hmh+XG/ScakBwHt0IYrWWwQ6GE14EjInSmYF3VEQ+5o='
WHERE
key_id = '58909a9d583facd028a39a25f9e1e470fb188636ca14b5508943b9f21cea3431'
AND (
token = 'Hmh+XG/ScakBwHt0IYrWWwQ6GE14EjInSmYF3VEQ+5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)