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