UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nl1pmT6h3qwzZ4Rn5DSsXNnvlOOG4qm91brI9HK55g='
WHERE
key_id = '7594276f476b54ca6a89639448c6aaabc0dd5d35b01bec48749aec4750cdbb0e'
AND (
token = '9nl1pmT6h3qwzZ4Rn5DSsXNnvlOOG4qm91brI9HK55g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)