UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GiuDnQUEM2mpfzGCz+9mZJbSCMauFMOWP9pTebun+lg='
WHERE
key_id = '983aedd734118b221e2cf32f8604a924f96e94f31db2d06e08b332be3525eda7'
AND (
token = 'GiuDnQUEM2mpfzGCz+9mZJbSCMauFMOWP9pTebun+lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)