UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6z0Kxh+bGy3nc6QZw27adNth05zINWgll7OpRcJToDY='
WHERE
key_id = 'da4134e06452dc461ea82d394e0ebcea2cc7e1ada2b2f42ea1aec794b65b45f0'
AND (
token = '6z0Kxh+bGy3nc6QZw27adNth05zINWgll7OpRcJToDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)