UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JXfpkN+eQQxaxlkss/r2f8HMhsbPdR3mtGLEOT7wpbw='
WHERE
key_id = '6b740f72749428fac8b252ae1b8f5b062f3a0d3cc64d7bfd88f449634f66b80d'
AND (
token = 'JXfpkN+eQQxaxlkss/r2f8HMhsbPdR3mtGLEOT7wpbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)