UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fb/W0ygexNKKIu+yN94QtodmEPJIJNg3Y6N1LdIrG44='
WHERE
key_id = '2029594c6c557ebb58d93b1fcfe14c88a28e8860f9695be009d9ec25cdca1163'
AND (
token = 'Fb/W0ygexNKKIu+yN94QtodmEPJIJNg3Y6N1LdIrG44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)