UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mSyUE0qEaOXN3pHmz/hwyEbf/Rez9SC3RQ8rD3khjvk='
WHERE
key_id = '0f2df365c31261a38133a251154e4aeac890989ad8c7f22fd37da930042ee9ac'
AND (
token = 'mSyUE0qEaOXN3pHmz/hwyEbf/Rez9SC3RQ8rD3khjvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)