UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xijm4252ldc6rbAy/GcJJyj9U9RmxvJjmiBpN2XKKMA='
WHERE
key_id = '32fc3c7865c732d09cb7ec21e1126d7504a6e1a016f4a4dd62771c65503f79cc'
AND (
token = 'xijm4252ldc6rbAy/GcJJyj9U9RmxvJjmiBpN2XKKMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)