UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wsys5Nw6qQsL4lup5wZEGerJ3JItIOXI0tSU6nypKWU='
WHERE
key_id = 'cb2fe0f28e56fcff3a15688fff5b75ae112d576265ccfda9d9e50be497e2048f'
AND (
token = 'Wsys5Nw6qQsL4lup5wZEGerJ3JItIOXI0tSU6nypKWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)