UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODtu68Z5+H80KtUywM7AEHGiIbc7U4j6jn9lVNZupVw='
WHERE
key_id = '79b9c3288a369962d3ebc1e11dfdbdeb22a7208c4d061db1dbc18777de4d582d'
AND (
token = 'ODtu68Z5+H80KtUywM7AEHGiIbc7U4j6jn9lVNZupVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)