UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TluTdvizPVbcec//YKC905eMLnF0OBfcDkd3Sisq02U='
WHERE
key_id = '8b5a1e108cd60dcd0f35fd903925a6c6e2f1c42ecee136c14ef232f5853db339'
AND (
token = 'TluTdvizPVbcec//YKC905eMLnF0OBfcDkd3Sisq02U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)