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