UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lw/9D72XOaxwLNLeyXFTC9mQFSSDeYEPEAKbP/0AaZQ='
WHERE
key_id = 'eb3bd5b85f47de8364d249f5bf64ba20401eb19c4972b1523021821a257ab1e4'
AND (
token = 'Lw/9D72XOaxwLNLeyXFTC9mQFSSDeYEPEAKbP/0AaZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)