UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd2L0DbW0IGLsbS43C/rdKoCs1ggUuQUeA4pVB3kkdfI='
WHERE
key_id = '0bf8c2a3d653f15ba5f137d924740051f1ff08dac6b66c629936119dcd5f1e4e'
AND (
token = 'd2L0DbW0IGLsbS43C/rdKoCs1ggUuQUeA4pVB3kkdfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)