UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jTRs3cp2US7g9tOeUaV43nV5X1/KaCi9nC/mhZZHaV8='
WHERE
key_id = '9f72f11f7183438014a1a24ceba6cd2232780d5532fa49ce165b0e4d8419d968'
AND (
token = 'jTRs3cp2US7g9tOeUaV43nV5X1/KaCi9nC/mhZZHaV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)