UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/CKKLYK6ZLsPPBWhWxWOCwCtKt3jemThgV4bP19INN0='
WHERE
key_id = '31ee496daea5e85f4eb18f0e589c1dd402a7b9e019f9c84ce23086a196ec9a2b'
AND (
token = '/CKKLYK6ZLsPPBWhWxWOCwCtKt3jemThgV4bP19INN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)