UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lYbbn6kWVjzMSybBi5cmmCry8nPp9coPxbFuVzkMzbU='
WHERE
key_id = '0c219de35c698ad5a9f566921fe3c1ddef566900e60fc96393818eb8881599ce'
AND (
token = 'lYbbn6kWVjzMSybBi5cmmCry8nPp9coPxbFuVzkMzbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)