UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVbzZE8UV2q+zAY53IWTEcAKX2R48rBQOIO/dcqXcHE='
WHERE
key_id = '378925623ba48ae967edecbcc0985041100f53a17ef6a7f4f7e9737e2c84f673'
AND (
token = 'oVbzZE8UV2q+zAY53IWTEcAKX2R48rBQOIO/dcqXcHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)