UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZKL4U0uMCtaFB3Tvqxqi7gQj6mSsxM2fexZBXDZ6pFc='
WHERE
key_id = '82f52d1caeba3c5b4bf6d5e544a405c521d707852d18f275ec8acf81df533d42'
AND (
token = 'ZKL4U0uMCtaFB3Tvqxqi7gQj6mSsxM2fexZBXDZ6pFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)