UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KmZYIhM6ulPUUJx3xkbtuTMlXzEjSU37Di7FdYnTJwQ='
WHERE
key_id = '5ac1d056d30251c5295e02616365a0432f40d7cc5beca533c471339704bf5966'
AND (
token = 'KmZYIhM6ulPUUJx3xkbtuTMlXzEjSU37Di7FdYnTJwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)