UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tELYV1zt2OoE7mptnhL3/wlFgB+CvZU8mNgq4ITRwA='
WHERE
key_id = '109890e49656d326d72bb9e14c75b96f96c8a178f9870fa62320cf5154d259fc'
AND (
token = '8tELYV1zt2OoE7mptnhL3/wlFgB+CvZU8mNgq4ITRwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)