UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K74d+f34VV+YBNGi/HtvLtwr2domK1scb+cNkKRvCi4='
WHERE
key_id = '41c8788b9a06267449ad52a33f2327c178dd15f0a8ca2ccb9248080f303c3f31'
AND (
token = 'K74d+f34VV+YBNGi/HtvLtwr2domK1scb+cNkKRvCi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)