UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5Hu0UBwnKTJ2MNE6JHbGVm3fSXia+bCAlaPFskMum0='
WHERE
key_id = 'e6abe75a1cea74447263a3874ce196399b7d0f0cc89e773d4d8a2f9b42a2738f'
AND (
token = 'k5Hu0UBwnKTJ2MNE6JHbGVm3fSXia+bCAlaPFskMum0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)