UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bGig1SXx71KAF2Gr5n8ppqXOo7v0h3K8dNaxmJK4bRk='
WHERE
key_id = '2becadc5a0c23159bd0b718d7cb24d848c5196ffcae95e8ff044e69a16b1f6ee'
AND (
token = 'bGig1SXx71KAF2Gr5n8ppqXOo7v0h3K8dNaxmJK4bRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)