UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huNwWzyGdQntoKDJ7Gu7sBJbNIpl7HKDXghgXUPijws='
WHERE
key_id = 'c02a1510344624016a908799c04406c042a2ecc5f14444b8d210e7977624515d'
AND (
token = 'huNwWzyGdQntoKDJ7Gu7sBJbNIpl7HKDXghgXUPijws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)