UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WygBucIyw61TTxba/VgwnXqK3HY4HKGDWzUVnWL4Ptw='
WHERE
key_id = 'bb7be1a4353ba14bdfe293c79d45721bcb38edde34ae922e7eb8810bc5064f11'
AND (
token = 'WygBucIyw61TTxba/VgwnXqK3HY4HKGDWzUVnWL4Ptw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)