UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DnjxCoAcqhGeQ78ksCa3DKuMs4OkbC3B9A+ZWXR1pZk='
WHERE
key_id = 'be9a4d2a1a282494bd3e294eaea36d13b0fa6ed6238fb94f924076bfe22f3cd9'
AND (
token = 'DnjxCoAcqhGeQ78ksCa3DKuMs4OkbC3B9A+ZWXR1pZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)